/*
 * File     : NativeLongStructure.java
 * Created  : 2 Jan 2012
 *
 * Copyright © 2011 Matthew Wilson (mj. {my-surname} .uk {at} gmail.com)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.googlecode.dni.type.utility;

import com.googlecode.dni.DirectNativeInterface;
import com.googlecode.dni.library.Symbol;
import com.googlecode.dni.type.LongReference;
import com.googlecode.dni.type.nativetype.NativeLong;
import com.googlecode.dni.type.structure.Structure;
import com.googlecode.dni.type.structure.StructureFactory;

/**
 * <p>
 *  Encapsulates a reference to a numeric natively sized <code>long</code> value
 *  that can be used in many contexts.
 * </p>
 * <p>
 *  As with a normal structure, the memory is allocated when the object is
 *  created, and must be explicitly freed when no longer required.  The explicit
 *  memory management allows it to be used in
 *  {@linkplain Structure structures} or by {@linkplain Symbol symbols}.
 * </p>
 * <p>
 *  Note that this type maps to a pointer to a <em>single</em> value only, not a
 *  list of values.
 * </p>
 *
 * @see LongReference
 *
 * @author Matthew Wilson
 */
public interface NativeLongStructure extends Structure
{

    /**
     * Factory instance for creating instances of {@link NativeLongStructure}.
     */
    public static final StructureFactory< NativeLongStructure > FACTORY =
        DirectNativeInterface.getStructureFactory( NativeLongStructure.class );

    /**
     * Obtains the value.
     *
     * @return the value
     */
    @NativeLong long getValue();

    /**
     * Sets the value.
     *
     * @param value
     *            the value to set
     */
    void setValue( long value );

}
